/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webtransac.comercial.controller.util;

/**
 *
 * @author efranco
 */
import com.webtransac.comercial.entity.Menu;
import java.util.LinkedList;
import org.zkoss.zul.DefaultTreeNode;
import org.zkoss.zul.TreeNode;
 
public class CategoryTreeNode extends DefaultTreeNode<Menu> {
    private static final long serialVersionUID = 1L;
    int count;
 
    public CategoryTreeNode(Menu menu, int count) {
        super(menu, new LinkedList<TreeNode<Menu>>()); // assume not a leaf-node
        this.count = count;
    }
 
    public String getDescription() {
        return getData().getDescripcion();
    }
 
    public int getCount() {
        return count;
    }
  
    public boolean isLeaf() {
        return getData() != null && getData().getChildren().isEmpty();
    }
}